import { post } from '@/utils/request'

/**
 * 移除错题
 * @param ids
 * @param removeFav
 * @param removeNote
 * @returns {Promise}
 */
export function deleteQu(ids, removeFav, removeNote) {
  return post('/api/client/book/delete', { ids, removeFav, removeNote })
}

/**
 * 答对自动移除
 * @param refId
 * @param quId
 * @returns {Promise}
 */
export function autoRemove(refId, quId) {
  return post('/api/client/book/auto-remove', { refId, quId })
}

/**
 * 收藏题目
 * @param refType
 * @param refId
 * @param quId
 * @param favMark
 * @returns {Promise}
 */
export function markFav(refType, refId, quId, favMark) {
  return post('/api/client/book/mark-fav', { refType, refId, quId, favMark })
}

/**
 * 查找题目的收藏和笔记情况
 * @param refType
 * @param refId
 * @param quId
 * @returns {Promise}
 */
export function findMark(refType, refId, quId) {
  return post('/api/client/book/find-mark', { refType, refId, quId })
}


/**
 * 保存笔记内容
 * @param refType
 * @param refId
 * @param quId
 * @param favNote
 * @returns {Promise}
 */
export function writeNote(refType, refId, quId, favNote) {
  return post('/api/client/book/write-note', { refType, refId, quId, favNote })
}


/**
 * 查找错题信息
 * @param id
 * @returns {Promise}
 */
export function bookDetail(id) {
  return post('/api/client/book/detail', { id })
}

